# 类型注解
import json
import random
from typing import Union

var_1: int = 10
var_2: str = "hello world"
var_3: float = 3.14


class Student:
    pass


stu: Student = Student()

my_list: list = [1, 2, 3]
my_tuple: tuple = (1, 2, 3)
my_dict: dict = {"name": "张三", "age": 18}
my_set: set = {1, 2, 3}

# 注释注解
var_4 = random.randint(1, 10)  # type: int
var_5 = json.loads('{"name": "张三"}')  # type: dict
var_6 = Student()  # type: Student


def add(a: int, b: int) -> int:
    return a + b


sum = add(1, 2)
print(sum)

myList: list[Union[int, str]] = [1, "hello"]


def func(data: Union[int, str]) -> Union[int, str]:
    pass
